<include file="application/walletyhbbadmin/view/public/left.html"/>
 <div id="dcMain">
   <!-- 当前位置 -->
<div id="urHere">物流管理<b>></b><strong>用户地址表</strong> </div>
     <div class="mainBox" style="height:auto!important;height:550px;min-height:550px;">
         <form action="{:U('Wuliu/yonghudizhi')}" method="post">
             &nbsp;用户名称: &nbsp;<input class="inpMain" placeholder="用户名称" name="consignee" value=""  type="text">
             &nbsp;用户ID: &nbsp;<input class="inpMain" placeholder="用户ID" name="user_id" value=""  type="text">
             &nbsp;手机号: &nbsp;<input class="inpMain" placeholder="手机号" name="mobile" value=""  type="text">
             <input name="submit" class="btnGray" type="submit" value="搜索" />
         </form>
         <br>
     <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
    <tr>
        <th align="center">ID</th>
        <th align="center">用户id</th>
        <th align="center">收货人</th>
        <th align="center">邮箱地址</th>
        <th align="center">国家</th>
        <th align="center">省份</th>
        <th align="center">城市</th>
        <th align="center">地区</th>
        <th align="center">地址</th>
        <th align="center">邮政编码</th>
        <th align="center">手机</th>
        <th align="center">默认收货地址</th>
        <th align="center">操作</th>
    </tr>
    <volist name="yh" id="vs" empty="$empty">
    <tr>
        <td align="center">{$vs.address_id}</td>
        <td align="center">{$vs.user_id}</td>
        <td align="center">{$vs.consignee}</td>
        <td align="center">{$vs.email}</td>
        <td align="center">{$vs.country}</td>
        <td align="center">{$vs.sheng}</td>
        <td align="center">{$vs.shi}</td>
        <td align="center">{$vs.qu}</td>
        <td align="center">{$vs.address}</td>
        <td align="center">{$vs.zipcode}</td>
        <td align="center">{$vs.mobile}</td>
        <td align="center">{$vs.is_default}</td>
        <td align="center">
        <a href="JavaScript:void(0);" onclick="gg_del({$vs.address_id})" class="del" did="{$vs.address_id}">删除</a>&nbsp;&nbsp;<a class="link-update" href="{:U('Wuliu/edityonghu',array('address_id'=>$vs['address_id']))}">修改</a>
        </td>
    </tr>
    </volist>
    </table>
</div>
     <div><center>{$page}</center></div>
</div>
<div class="clear"></div>
<include file="application/walletyhbbadmin/view/public/foot.html"/><!-- dcFooter 结束 -->
<div class="clear"></div>
<script>
    function gg_del(id){
        layer.confirm('是否确认删除?',function(){
            $.post("{:U('Wuliu/delYonghu')}",{address_id:id},function(data){
                layer.msg(data.info);
                if(data.status==1){
                    setTimeout(function(){
                        window.location.reload();
                    },1000)
                }
            })
        })
    }
</script>
<script type="text/javascript">
    $('#department_arr_1').change(function(){
        var id = $(this).val();
        if(id!==-1){
            $.post("{:U('Wuliu/getLevel')}",{id:id},function(data){
                // console.log(data.data);
                $('#department_arr_2').empty();   //清除后续下拉单
                $('#department_arr_3').empty();
                var html = '<option value="-1">请选择</option>';
                $('#department_arr_3').html(html);   // 插入请选择选项
                $('#department_arr_4').html(html);
                if(data.status==1){
                    var list = data.data;

                    for(var i=0; i<list.length; i++){
                        html += '<option value="'+list[i]['id']+'">'+list[i]['name']+'</option>';
                    }
                }
                $('#department_arr_2').html(html);
            })
        }
    })
    $('#department_arr_2').change(function(){
        var id = $(this).val();
        if(id!==-1){
            $.post("{:U('Wuliu/getLevel')}",{id:id},function(data){
                // console.log(data.data);
                $('#department_arr_3').empty();   //清除后续下拉单
                var html = '<option value="-1">请选择</option>';
                $('#department_arr_4').html(html);   // 插入请选择选项
                if(data.status==1){
                    var list = data.data;

                    for(var i=0; i<list.length; i++){
                        html += '<option value="'+list[i]['id']+'">'+list[i]['name']+'</option>';
                    }
                }
                $('#department_arr_3').html(html);
            })
        }
    })
</script>
</body>
</html>